#include<string>
#include<iostream>
#include<unordered_map>
using namespace std;
int main()
{
	unordered_map<string, int> mp;
	int n;cin >> n;
	while (n--)
	{
		string name;int op,po;
		cin >> op;
		switch (op)
		{
		case 1:
			cin >> name >> po;
				mp[name] = po;
				cout << "OK" << endl;
			break;
		case 2:
			cin >> name;
			if (mp.count(name)) cout << mp[name] << endl;
			else cout << "Not found" << endl;
			break;
		case 3:
			cin >> name;
			if (mp.count(name))
			{
				mp.erase(name);
				cout << "Deleted successfully" << endl;
			}
			else
			{
				cout << "Not found" << endl;
			}
			break;
		case 4:
			cout << mp.size() << endl;
			break;
		}
	}
	return 0;
}
//#include<vector>
//#include<string>
//#include<iostream>
//#include<unordered_map>
//using namespace std;
//int main()
//{
//	unordered_map<string, int> edges;
//	int n;cin >> n;
//	while (n--)
//	{
//		string s1;
//		int  po,op;cin >> op;
//		switch (op)
//		{
//		case 1:
//		{
//			cin  >> s1 >> po;
//			edges[s1] = po;	cout << "ok" << endl;
//		}
//		break;
//		case 2:
//			cin >> s1;
//			if (edges[s1] == 0)
//			{
//				cout << "Not found" << endl;
//			}
//			else
//			{
//				cout << edges[s1]<< endl;
//			}
//			break;
//		case 3:
//			cin >> s1;
//			if (edges.count(s1) == 0) cout << "Not found" << endl;
//			  else {
//				edges.erase(s1);
//					cout << "Deleted successfully" << endl;
//					}
//				break;
//		case 4:
//			cout << edges.size() << endl;
//			break;
//	}
//}
//	return 0;
//}